<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

function jsonGetLastError() {
	static $json_errors = array(
    JSON_ERROR_NONE => 'No error has occurred',
    JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded',
    JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded',
    JSON_ERROR_SYNTAX => 'Syntax error',
	);
	
	return $json_errors[json_last_error()];
}